<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>编辑疾病</title>
    <%@ include file="../../common/meta.jsp" %>
    <%@ include file="../../common/common-body.jsp" %>
    <link href="${ctx}/css/page/common-win.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/common/myDateTimeFormat.js?t=${now}"></script>
    <script src="${ctx}/js/plugins/jquery.ajaxfileupload-2.1.js?t=${now}"></script>
    <link href="${ctx}/css/plugins/note/note.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/plugins/note/note.js?t=${now}"></script>
    <script src="${ctx}/js/ueditor/ueditor.config.js?t=${now}"></script>
    <script src="${ctx}/js/ueditor/ueditor.all.js?t=20181010"></script>
    <script src="${ctx}/js/plugins/jquery.qrcode.min.js?t=${now}"></script>
    <style>
        #_btnDiv{
            height: 34px;
            margin-bottom: 0px;
        }
        .pull-left.pagination-detail{
            display: none;
        }
        .note{
            border: 1px solid #e5e6e7 ;
            width: 100%;
            height: 150px;
            overflow-y:auto;
        }
        .mySearchBtn{
            padding-top: 14px!important;
            padding-bottom: 14px!important;
            margin-bottom: 0px!important;
        }
        .divNote{
            height: 130px
        }

    </style>
    <script>
        var dto = ${dto};
        var searchInfo = ${searchInfo};
    </script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="tabs-container">
        <div class="myContent">
            <div class="tabs-container">
                <div class="tab-content">
                    <div id="tab-1" class="tab-pane active">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="ibox float-e-margins myIbox">
                                    <div class="ibox-title">
                                        <h5 class="page-header page-header-new"></h5>
                                    </div>
                                    <table class="_tabTable">
                                        <tr>
                                            <td class="active" onclick="onClickTab(this)" id="_tab1">基本信息</td>
                                            <td onclick="onClickTab(this)" id="_tab2">疾病介绍</td>
                                            <td onclick="onClickTab(this)" id="_tab3">疾病维度</td>
                                        </tr>
                                    </table>
                                    <div id="_div1" class="ibox-content">
                                        <form class="form-horizontal m-t" id="sicknessForm" name="sicknessForm">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label"><span style="color: red">*</span>平台疾病编码：</label>
                                                <div class="col-sm-3">
                                                    <input type="hidden" id="id" name="id" value="${not empty dto ? dto.id : ''}">
                                                    <input type="text" id="sicknessCode" name="sicknessCode" class="form-control" placeholder="32字符以内" required maxlength="32" value="${not empty dto ? dto.sicknessCode : ''}" >
                                                    <span class="help-block m-b-none tip"></span>
                                                </div>
                                                <label class="col-sm-2 control-label">ICD-10编码：</label>
                                                <div class="col-sm-3">
                                                    <input type="text" id="idctenCode" name="idctenCode" class="form-control" placeholder="32字符以内"  maxlength="32" value="${not empty dto ? dto.idctenCode : ''}" >
                                                    <span class="help-block m-b-none tip"></span>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label"><span style="color: red">*</span>疾病名称：</label>
                                                <div class="col-sm-8">
                                                    <input type="text" id="sicknessName" name="sicknessName" class="form-control" placeholder="50字符以内" required maxlength="50" value="${not empty dto ? dto.sicknessName : ''}" >
                                                    <span class="help-block m-b-none tip"></span>
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">疾病简称：</label>
                                                <div class="col-sm-3">
                                                    <input type="text" id="shortName" name="shortName" class="form-control" placeholder="10字符以内"  maxlength="10" value="${not empty dto ? dto.shortName : ''}" >
                                                    <span class="help-block m-b-none tip"></span>
                                                </div>
                                                <label class="col-sm-2 control-label">内容来源：</label>
                                                <div class="col-sm-3">
                                                    <input type="text" id="source" name="source" class="form-control" placeholder="10字符以内"  maxlength="10" value="${not empty dto ? dto.source : ''}" >
                                                    <span class="help-block m-b-none tip"></span>
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">疾病详情url：</label>
                                                <div class="col-sm-8">
                                                    <input type="text" id="otherInfoUrl" name="otherInfoUrl" class="form-control"  value="${not empty dto ? dto.otherInfoUrl : ''}" >
                                                    <span class="help-block m-b-none tip"></span>
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">排序：</label>
                                                <div class="col-sm-3">
                                                    <input type="text" id="sortNum" name="sortNum" class="form-control" maxlength="9" isPInteger="true"  value="${not empty dto ? dto.sortNum : ''}" >
                                                    <span class="help-block m-b-none tip"></span>
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <div class="col-sm-2 control-label divNote" style="height: 100px"><span style="color: red">*</span>所属二级科室：
                                                        <input type="button"  class="btn btn-primary btn-outline" onclick="selectDept()" value="添加科室" />
                                                </div>
                                                <div class="col-sm-7">
                                                    <div class="note" id="dept"  name="dept" readonly="true">
                                                        <c:forEach items="${dto.deptInfo}" var="item" >
                                                            <div class="note_lable"  name="dept" value="${item.deptCode}">
                                                                <lable>${item.deptName}</lable>
                                                                <div  onclick="$(this).parent().remove()">X</div>
                                                                <div  class="note_mind"></div>
                                                            </div>
                                                        </c:forEach>
                                                    </div>
                                                </div>
                                                <label id="dept-error" class="note_error" style="display: none;"><i class="fa fa-times-circle"></i>  必选</label>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">疾病别称：</label>
                                                <div class="col-sm-8">
                                                    <textarea type="text" id="alias" name="alias" colspan="3" placeholder="别称之间逗号分隔" class="form-control" maxlength="500" value="${not empty dto ? dto.alias : ''}">${not empty dto ? dto.alias : ''}</textarea>
                                                    <span class="help-block m-b-none tip"></span>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">疾病症状：</label>
                                                <div class="col-sm-8">
                                                    <textarea type="text" id="symptom" name="symptom" colspan="3" placeholder="症状之间逗号分隔" class="form-control" maxlength="500" value="${not empty dto ? dto.symptom : ''}">${not empty dto ? dto.symptom : ''}</textarea>
                                                    <span class="help-block m-b-none tip"></span>
                                                </div>
                                            </div>
                                        </form>
                                        <div class="ibox float-e-margins">
                                            <div class="ibox-content">
                                                <div class="form-group" id="_btnDiv1">
                                                    <div class="col-sm-4 col-sm-offset-5">
                                                        <input type="button" class="btn btn-primary" onclick="doSaveSick()" value="保存">
                                                        <input type="button" class="btn btn-white" onclick="doCheckDataChange()" value="返回">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ibox-content" id="_div2" style="display: none;">
                                        <div class="tabs-container">
                                            <div class="tab-content">
                                                <div id="tab" class="tab-pane active">
                                                    <div class="row">
                                                        <div class="col-sm-12">
                                                            <div class="ibox float-e-margins myIbox">
                                                                <div class="ibox-content">
                                                                    <div class="form-group ">
                                                                        <div class="col-sm-10" >
                                                                            <script id="sickDesc" name="sickDesc" type="text/html"></script>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group" >
                                                                        <div class="col-sm-12 col-sm-offset-4" style="margin-right: 200px">
                                                                            <input type="button" class="btn btn-white" onclick="showQrCode()" value="扫码预览" >
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ibox-content" id="_div3" style="display: none;">
                                        <div class="tabs-container">
                                            <div class="tab-content">
                                                <div id="tab-2" class="tab-pane active">
                                                    <div class="row">
                                                        <div class="col-sm-12">
                                                            <div class="ibox float-e-margins myIbox">
                                                                <div class="ibox-content">
                                                                    <div class="form-group">
                                                                        <label class="col-sm-2 control-label">疾病概述：</label>
                                                                        <div class="col-sm-10">
                                                                            <textarea type="text" id="summarize" name="summarize" colspan="3" class="form-control" maxlength="500" value="${not empty dto ? dto.summarize : ''}">${not empty dto ? dto.summarize : ''}</textarea>
                                                                            <span class="help-block m-b-none tip"></span>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="col-sm-2 control-label">临床检查：</label>
                                                                        <div class="col-sm-10">
                                                                            <textarea type="text" id="clinical" name="clinical" colspan="3"  class="form-control" maxlength="500" value="${not empty dto ? dto.clinical : ''}">${not empty dto ? dto.clinical : ''}</textarea>
                                                                            <span class="help-block m-b-none tip"></span>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/js/plugins/validate/jquery.validate.custom.js?t=20181024"></script>
<script src="${ctx}/js/sickness/win/editSicknessMgr.js?t=${now}"></script>


<div id="selectDept" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header text-center">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>添加科室</h4>
            </div>
            <div class="modal-body modal-body-height my-modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins" style="margin-bottom: 0px;">
                            <div class="ibox-content ibox-content-search none-border" style="padding-bottom: 0px;">
                                <form class="form-horizontal m-t" novalidate="novalidate">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label control-model">科室名称：</label>
                                        <div class="col-sm-10">
                                            <div class="input-group" style="width: 460px!important;">
                                                <input type="text" name="columnDeptName" id="columnDeptName" class="form-control" onkeydown="if(event.keyCode==13){doDeptRefresh();return false;}"
                                                       maxlength="30">
                                                <span class="input-group-btn"> <button type="button" class="btn btn-primary" onclick="doDeptRefresh()">查询</button></span>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th style="width: 145px;">一级科室</th>
                            <th>二级科室</th>
                        </tr>
                        </thead>
                        <tbody id="columnDeptData">
                        <c:forEach items="${columnDeptMap}" var="item">
                            <tr>
                                <td>
                                    <label name="columnDept" idd="oneDept">${item.name} </label>
                                </td>
                                <td id="depts">
                                    <c:forEach items="${item.depts}" var="dept">
                                        <label idd="${dept.deptName}" style="width: 140px;float: left;">
                                            <input type="checkbox" id="columnDept" name="columnDept" idd="${item.code}" value="${dept.deptCode}"/>${dept.deptName}&nbsp;&nbsp;
                                        </label>
                                    </c:forEach>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-info" onclick="doAddColumnDept()">保存</button>
                <button class="btn btn-white" onclick="$('#selectDept').modal('hide')">取消</button>
            </div>
        </div>
    </div>
</div>



<div id="scanQrCodePage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header text-center">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>扫码预览</h4>
            </div>
            <div class="modal-body modal-body-height">
                <div class="row">
                    <div class="col-sm-12 text-center">
                        <div id="qrcode" style="height: 250px; width: 250px;padding-left: 150px"></div>
                    </div>
                    <div class="col-sm-12 text-center">打开支付宝钱包扫一扫即可查看效果</div>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-white" onclick="$('#scanQrCodePage').modal('hide')">关闭</button>
            </div>
        </div>
    </div>
</div>

</body>
</html>

